
package com.epam.android.training.level1.poll;

import com.epam.android.training.level1.UniqueEntity;

import java.util.ArrayList;
import java.util.List;

/**
 * @author Anton Novikau
 */
public class PollBo implements UniqueEntity {
  private long id;

  private String displayName;

  private int passedPercent;

  private List<Long> questionIds;

  @Override
  public long getId() {
    return id;
  }

  public void setId(long id) {
    this.id = id;
  }

  public String getDisplayName() {
    return displayName;
  }

  public void setDisplayName(String displayName) {
    this.displayName = displayName;
  }

  public List<Long> getQuestionIds() {
    if (questionIds == null) {
      questionIds = new ArrayList<Long>();
    }

    return questionIds;
  }

  public void setQuestions(List<Long> questionIds) {
    this.questionIds = questionIds;
  }

  public void addQuestionId(Long questionId) {
    getQuestionIds().add(questionId);
  }

  public void setPassedPercent(int passedPercent) {
    this.passedPercent = passedPercent;
  }

  public int getPassedPercent() {
    return passedPercent;
  }

  @Override
  public String toString() {
    return getDisplayName();
  }
}
